// 找到头文件
#include <workflow/WFFacilities.h>
#include <workflow/WFTaskFactory.h>
#include <workflow/HttpUtil.h>
#include <signal.h>
#include <iostream>

using namespace std;

// 定义全局变量
static WFFacilities::WaitGroup waitGroup(1);

void signalhandler(int signum)
{
    waitGroup.done(); // 每done一次，等待的n就-1
}

int main()
{
    signal(SIGINT, signalhandler);

    WFRedisTask *redisTask = WFTaskFactory::create_redis_task(
        "redis://127.0.0.1:6379", 10, nullptr); // 创建任务
    protocol::RedisRequest *req = redisTask->get_req();
    req->set_request("SET", {"62test", "world"}); // 设置任务请求

    redisTask->start(); // 交给框架

    waitGroup.wait();
    cout << "finished!\n";

    return 0;
}